<extend name="Public/base"/>

<block name="style">
    <style type="text/css">

        .zaixian_shou{
            width: 40px;
            height: 40px;
            border-radius: 50% 50%;

        }
        .path2_status{
            width: 40px;
            height: 40px;
            border-radius: 50% 50%;

        }
        .frozen{
            width: 40px;
            height: 40px;
            border-radius: 50% 50%;


        }

     .side-sub-menu > li > .item {
                color: #000;
                font-family: '宋体';
                font-size:15px;padding:0px;
                line-height: 25px;
            }
    .sidebar {
        background:#3697A0;
        position: absolute;
    }   
  

     /* 头部Logo,主导航*/
            body{
                color:#000;
                font-family: '宋体';
                font-weight: 900;
            }
            .header {
                background-color:   #3697A0;
                height: 45px;
            }
            /* 主导航 */
            .main-nav a {
                height: 45px;
                color: #150303;
            }
            .main-nav a:hover {
                height: 45px;
                background-color:#70bcf3;
                color: #150303;
            }
            .main-nav .current{
                height: 45px;
                background-color: #70bcf3;
            }
            .main-nav .current a {
                height: 45px;
                background-color: #70bcf3;
                color: #150303;
            }
            .logo{
                height: 45px;
                background: #ccc;
            }
            .sidebar{
                margin-top:-5px;
                background:    #3697A0;
                color: #000;
            }
            .subnav h3{
                color: #000;
            }

            .main-nav {
                /*width:100%;*/
                float: none;
                height: auto;
            }

            .mainnav {
                /*height: auto;*/
                height: 100%;
            }

            .main-nav li{
                float: none;
                width:180px;
            }

            .btn{

    background: #09c;
}
.btn:hover{
    background: #09c;
}
    </style>
</block>

<block name="body">

	<div class="main-title">
		<h2>公告管理</h2>
	</div>
   


                <div  class="tab-pane">
                    <form action="" method="post" class="form-horizontal" onsubmit="return false">
                            <div class="cf">
                                <div class="fl">
                                    <select name="uids" style="height:40px;width:200px;">
                                        <option value="0">请选择发送范围</option>
                                        <option value="1">0-200</option>
                                        <option value="2">200-400</option>
                                        <option value="3">400-600</option>
                                        <option value="4">600-800</option>
                                        <option value="5">800-1000</option>
                                        <option value="6">1000-1200</option>
                                        <option value="7">1200-1400</option>
                                        <option value="8">1400-1600</option>
                                        <option value="9">1600-1800</option>
                                        <option value="10">1800-2000</option>
                                        <option value="12">2000-2200</option>
                                        <option value="13">2200-2400</option>
                                        <option value="14">2400-2600</option>
                                        <option value="15">2600-2800</option>
                                        <option value="16">2800-3000</option>
                                        <option value="17">3000-3200</option>
                                        <option value="18">3200-3400</option>
                                        <option value="19">3400-3600</option>
                                        <option value="20">3600-3800</option>
                                        <option value="21">3800-4000</option>
                                        <option value="22">4000-4200</option>
                                        <option value="23">4200-4400</option>
                                        <option value="24">4400-4600</option>
                                        <option value="25">4600-4800</option>


                            
                                    </select>

                                </div>

                            </div>


                            <div class="form-item">
                                <label class="item-label">系统运行状态</label>
                                <div class="controls">
                                    <input type="text" style="height:30px;" class="text input-large "  name="type" value="" placeholder="正常运行或维护中">
                                </div>
                               
                            </div>
                            <div class="form-item">
                                <label class="item-label">自定义语句</label>
                                <div class="controls">
                                    <input type="text" style="height:30px;" class="text input-large "  name="remark" value="" placeholder="感谢您的使用">
                                </div>
                               
                            </div>
                            


                            <div class="form-item">
                                <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">发布消息</button>

                                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                            </div>
                        </form>
            </div>



    <div class="page"  style="float:left;margin-right:300px;margin-top:20px;">{$_page}</div>
</block>

<block name="script">
    <link href="/Public/static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <link href="/Public/static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/Public/static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="/Public/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>


<script type="text/javascript">
    
        Think.setValue("extend", {$info.extend|default=0});
        //导航高亮
        highlight_subnav('{:U('gg')}');
 

        $('.add').click(function(){
            var time =getNowFormatDate();
                var str='';
                str+='<tr>'
                str+='<td class="id"></td>'
                str+='<td><textarea cols="50" rows="3" class="content"></textarea></td>'
                str+='<td>'+time+'</td>'
                str+='<td>&nbsp;&nbsp;删除</td>'
                str+='</tr>'
                $('.tbody').prepend(str)
        })

        /*

        $('.tbody').on('blur','.content',function(){
            var content=$(this).val()
            if(content==''){
               location.reload();
               return false;
            }
            $.ajax({
                type:'post',
                data:{'content':content},
                url:"{:U('gg?type=add')}",
                success:function(m){
                    if(m==1){
                       alert('新增成功！')

                      
                    }else{
                        alert('新增失败!')
                    }
                     location.reload();
                }
            })
        })


        $('.tbody').on('click','.delete',function(){
            var id=$(this).parent().find('.de').val()
          
            $.ajax({
                type:'post',
                data:{'id':id},
                url:"{:U('gg?type=delete')}",
                success:function(m){
                    if(m==1){
                       alert('删除成功！')
                    }else{
                        alert('删除失败!')
                    }
                     location.reload();
                }
            })
        })

        */

        $('#submit').click(function(){

            var type = $("input[name='type']").val();
            var remark = $("input[name='remark']").val();


            if(remark==''){
                location.reload();
                return false;
            }

            $.ajax({
                type:'post',
                data:{'type':type,'remark':remark},
                url:"{:U('ajaxAddGg')}",
                success:function(data){
                    alert('发布成功');
                    location.reload();
                }
            })
        });



        function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        var Seconds = date.getSeconds();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        if (Seconds >= 0 && Seconds <= 9) {
            Seconds = "0" + Seconds;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                + " " + date.getHours() + seperator2 + date.getMinutes()
                + seperator2 + Seconds;
        return currentdate;
    } 

</script>
</block>